-- reduce_attrib
-- create by panyl
-- 属性降低N%

return {
    apply = function(prop, baseValue)
        -- 提升的百分比
        local v = prop[3];

        if v == 0 or baseValue <= 0 then
            return baseValue;
        end

        -- 最少降低1点
        local add = math.modf(baseValue * v / 1000);
        if add < 1 then
            add = 1;
        end

        return math.max(1, baseValue - add);
    end,

    record = function(target, prop, path)
        return false;
    end 
};
